<?php include( "templates/include/header.php" );
  include( "templates/include/adminHeader.php" );?>
 
      <div id="adminHeader">
        <h2>Administation de la page d'Accueil</h2>
        <p>Vous &ecirc;tes connect&eacute; en tant que <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Se D&eacute;connecter</a></p>
      </div>
 
      <h1>Tous les Partenaires</h1>
 
<?php if ( isset( $results['errorMessage'] ) ) { ?>
        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
<?php } ?>
 
 
<?php if ( isset( $results['statusMessage'] ) ) { ?>
        <div class="statusMessage"><?php echo $results['statusMessage'] ?></div>
<?php } ?>

<?php foreach ( $results['sponsor'] as $sponsor ) { ?>
  <table align="center" width="90%" cellpadding="5px" cellspacing="0" border="0">
    <tr onclick="location='admin.php?action=editSponsor&amp;sponsorId=<?php echo $sponsor->id?>'" height="230px">
      <td width="300px" valign="top" style="margin:0;padding:0" align="left">
        <div align="left" style="margin:0;padding:0;width:300px;height:200px">
          <img src="<?php echo $sponsor->image ?>" width="300px" height="200px"/>
        </div>
      </td>
      <td valign="middle" align="justify">
        <?php echo $sponsor->name ?>
      </td>
      <td valign="middle" align="justify">
        <?php echo $sponsor->url ?>
      </td>
    </tr>
  </table>
<?php } ?>

      <p><?php echo $results['totalRows']?> article<?php echo ( $results['totalRows'] != 1 ) ? 's' : '' ?> au total.</p>
 
      <p><a href="admin.php?action=newSponsor">Ajouter un partenaire</a></p>
 
<?php 
  include( "templates/include/adminFooter.php" );
  include( "templates/include/footer.php" ); ?>
